package com.xiaobai.zhuangxiuguanjia.model;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2015/6/17 0017.
 */
public class CommonData {
    private String article_id;
    private String title;
    private String filename;
    private String puttime;
    private String collection;
    private String summary;
    private String click;
    private String webUrl;
    private String rows;
    private String oldcid;
    private String edittime;
    List<Info> infoList;
    public void parseJSON(JSONObject json){
        article_id = json.optString("article_id");
        title = json.optString("title");
        filename = json.optString("filename");
        puttime = json.optString("puttime");
        collection = json.optString("collection");
        summary = json.optString("summary");
        click = json.optString("click");
        webUrl = json.optString("webUrl");
        rows = json.optString("rows");
        oldcid = json.optString("oldcid");
        edittime = json.optString("edittime");
        infoList = new ArrayList<Info>();
        JSONArray infos = json.optJSONArray("info");
        if (infos!=null) {
            for (int i = 0; i < infos.length(); i++) {
                JSONObject jsonObject = infos.optJSONObject(i);
                Info info = new Info();
                info.parseJSON(jsonObject);
                infoList.add(info);
            }
        }
    }

    public String getArticle_id() {
        return article_id;
    }

    public String getTitle() {
        return title;
    }

    public String getFilename() {
        return filename;
    }

    public String getPuttime() {
        return puttime;
    }

    public String getCollection() {
        return collection;
    }

    public String getSummary() {
        return summary;
    }

    public String getClick() {
        return click;
    }

    public String getWebUrl() {
        return webUrl;
    }

    public String getRows() {
        return rows;
    }

    public String getOldcid() {
        return oldcid;
    }

    public String getEdittime() {
        return edittime;
    }

    public List<Info> getInfoList() {
        return infoList;
    }
}
